/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Logica;

import Dato.DRol;
import Objetos.Rol;
import java.sql.SQLException;
import java.util.ArrayList;
import javax.swing.table.DefaultTableModel;

/**
 *
 * @author Omar Heráclides
 */
public class LRol {

    public String AgregarRol(Rol objRol) throws SQLException {
        DRol objDRol= new DRol();
      objDRol.AgregarRol(objRol);
        return  "Se agrego un nuevo ROL";
     
    }

    public DefaultTableModel MostrarRoles() throws SQLException {
         DRol objDRol= new DRol();
    return objDRol.MostrarRol();
    }

    public int ObtenerSecuencia() throws SQLException {
        DRol objDRol= new DRol();
     return objDRol.ObtenerIdRol();
    }

    public String ModificarRol(Rol objRol) throws SQLException {
          DRol objDRol= new DRol();
      objDRol.ModificarRol(objRol);
        return  "Se modifico un ROL";
    }

    public String Eliminar(String codRol) throws SQLException {
        DRol objDRol= new DRol();
      objDRol.EliminarRol(Integer.parseInt(codRol.trim()));
        return "Se elimino un registro";
    }

    public ArrayList<String> ObtenerRol() throws SQLException {
DRol objDRol= new DRol();
      return objDRol.ObtenerRol();
    }

    public ArrayList<String> ObtenerRolxPerfil(String name) throws SQLException {
       DRol objDRol= new DRol();
      return objDRol.ObtenerRolxPerfil(name);
    }

    
}
